<!DOCTYPE html>
<html lang="zh">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>RELIB</title>
  <link rel="stylesheet" href="./layui/css/layui.css">
  <link rel="shortcut icon" href="logo.ico" type="image/x-icon">
  <style>
    .layui-menu-item-checked::after {
      display: none;
    }

    .layui-menu-item-checked>* {
      color: #16b777;
    }


    .banxin {
      width: 1280px;
      margin: 0 auto;
      display: flex;
    }

    #demo-menu {
      user-select: none;
    }

    .right-big-box {
      height: calc(var(--winHeight) - 60px);
      width: 100%;
      box-sizing: border-box;
      padding-top: 20px;
      padding-bottom: 10px;
    }

    iframe {
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
      border: none;
    }

    .re-container {
      height: 60px;
      /* background-color: pink; */
      box-shadow: 0 0 3px #ccc;
    }

    .layui-panel {
      box-shadow: none;
      margin-top: 0 !important;
      margin-bottom: 0 !important;
      border-bottom: none !important;
    }
  </style>
</head>

<body>
  <div class="re-container">
    <div class="banxin" style="align-items: center;height: 60px;justify-content: space-between;">
      <div class="left" style="display: flex;align-items: center;">
        <h1 style="padding-left: 40px;">ReLib</h1>
      </div>
      <div class="right" style="padding-right: 40px;">
        <a target="_blank" href="https://gitee.com/miaoladiqi/ReLib">
          <img style="height: 26px;" src="http://yfblog.asia/image/YFBLOG_1693474587359.ico" alt="">
        </a>
      </div>
    </div>
  </div>
  <div class="banxin">
    <div class="layui-panel left-box" style="width: 200px; margin: 10px 16px 16px 0;">
      <ul class="layui-menu" id="demo-menu">
        <li class="layui-menu-item-group" lay-options="{type: 'group', isAllowSpread: false}">
          <div class="layui-menu-body-title">通用</div>
          <ul>
            <li class="layui-menu-item-checked">
              <div data-path="./relib/ReButton/ReButton.html" class="layui-menu-body-title">按钮</div>
            </li>
          </ul>
          <div class="layui-menu-body-title">交互</div>
          <ul>
            <li>
              <div data-path="./relib/ReModel/ReModel.html" class="layui-menu-body-title">弹窗</div>
            </li>
            <li>
              <div data-path="./relib/RePreviewImage/RePreviewImage.html" class="layui-menu-body-title">图片预览</div>
            </li>
          </ul>
        </li>
      </ul>
    </div>

    <div class="right-big-box">
      <iframe id="main"></iframe>
    </div>
  </div>
</body>
<script src="./layui/layui.js"></script>
<script>
  const { $ } = layui;

  const defaultPage = "./relib/ReButton/ReButton.html";
  // const defaultPage = "./relib/ReModel/ReModel.html";

  $("#main").prop("src", defaultPage);

  $(".layui-menu-body-title").on("click", function () {
    $("#main").prop("src", $(this).attr("data-path"));
  });


  document.body.style.setProperty("--winHeight", window.innerHeight + "px");
  window.onresize = function () {
    document.body.style.setProperty("--winHeight", window.innerHeight + "px");
  }


</script>

</html>